package org.jeecg.modules.online.cgreport.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.online.cgreport.entity.OnlCgreportHead;
import org.jeecg.modules.online.cgreport.model.OnlCgreportModel;

import com.baomidou.mybatisplus.extension.service.IService;

/**
 * @Description: 在线报表配置
 * @Author: jeecg-boot
 * @Date: 2019-03-08
 * @Version: V1.0
 */
public interface IOnlCgreportHeadService extends IService<OnlCgreportHead> {

	/**
	 * 修改全部项，包括新增、修改、删除
	 * 
	 * @param values
	 * @return
	 */
	Result<?> editAll(OnlCgreportModel values);

	/*
	* @Description: 删除online报表
	* @author: scott
	* @date: 2020/3/25 12:16
	* @param id: 
	* @Return: org.jeecg.common.api.vo.Result<?>
	*/
	public Result<?> delete(String id);

	/**
	* @Description: 批量删除成功
	* @author: scott
	* @date: 2020/3/25 11:48
	* @param ids: 多个主键ID
	* @Return: org.jeecg.common.api.vo.Result<?>
	*/
	public Result<?> bathDelete(String[] ids);

	/**
	 * 执行SQL语句
	 * 
	 * @param sql
	 * @return
	 */
    Map<String, Object> executeSelectSql(String sql, String onlCgreportHeadId, Map<String, Object> params) throws SQLException;

	/**
	 * 执行SQL语句
	 *
	 * @param sql
	 * @return
	 */
    Map<String, Object> executeSelectSqlDynamic(String dbKey, String sql, Map<String, Object> params, String onlCgreportHeadId);

	/**
	 * 动态数据源： 获取SQL解析的字段
	 */
	public List<String> getSqlFields(String sql,String dbKey) throws SQLException;

	
	/**
	 * 解析SQL参数
	 */
	public List<String> getSqlParams(String sql);

	Map<String, Object> queryCgReportConfig(String reportCode);
	
	public List<Map<?, ?>> queryByCgReportSql(String sql, Map params,Map paramData,int page, int rows);

}
